import 'dart:math';

import 'package:flutter/material.dart';

class MyPainter extends CustomPainter {
  @override
  void paint(Canvas canvas, Size size) {
    var p = Paint()
      ..isAntiAlias = true //	是否抗锯齿（bool）
      ..strokeWidth = 0.0 //画笔宽度 （double）
      ..color = Colors.green //画笔颜色（Color）
      ..invertColors = false;

    Rect rect = Rect.fromCircle(
        center: Offset(size.width / 2, size.height / 2), radius: 280);
    canvas.drawArc(rect, 0.0, 2 / pi *2, true, p);
  }

  @override
  bool shouldRepaint(covariant CustomPainter oldDelegate) => true;
}
